hash = (password) ->
    secure = '~!@#$%^&*()_+[]'
    md5 sha1(password)+secure

window.loginController = ($scope) ->
    $scope.applogin = ->
        $scope.app_login_hash = hash $scope.app_login_password
        return
    return

window.registerController = ($scope) ->
    return

tips_normal = (selector, text, show) ->
    options = (text) ->
        animation: 'true'
        deplay: 1000
        placement: 'left'
        content: text
        container: 'body'
    $(selector).popover options(text)
    $(selector).popover "show"  unless typeof show is `undefined`
    return

$(document).ready ->
    $('#app_register_password input').focusout = ->
        $(this).popover 'hide'
        return

    $('.app_register_question_suggest li').click = ->
        text = $(this).find('a')[0].innerHTML
        $('.app_register_question').val(text)
        return

    return